
import { _decorator, Component, Node, Vec4 } from 'cc';
import { GlobalEnum } from '../../Script/GameSpecial/GlobalEnum';
import { ParticleItem } from './ParticleItem';
const { ccclass, property } = _decorator;

/**行走时地面的灰尘粒子 */
@ccclass('WalkParticle')
export class WalkParticle extends ParticleItem {

    protected particleCount: number = 10;
    protected createAnim() {
        let Pos = [0, 0, 0, 0];
        let SO = [1, 0, 1, 0];
        let d = 0.5;
        let Time = [d, d, d, 0];
        let Ease = [0, 0, 0, 0];
        let s0 = 0.2;
        let s1 = 0.15;

        for (let i = 0; i < this.particleCount; ++i) {
            Pos[0] = (Math.random() - 0.5) * 0.3;
            Pos[1] = 0.15 + (Math.random() - 0.5) * 0.3;
            Pos[2] = Pos[0] + (Math.random() - 0.5) * 0.1;
            Pos[3] = Pos[1] + (Math.random() - 0.5) * 0.1;
            SO[0] = s0 + Math.random() * s1;
            this.cacheParticleAnim(i, Pos, SO, Time, Ease);
        }
    }

}
